package com.kun.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kun.alldb.base.DatasourceBase;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName kun_datasource
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value ="kun_datasource")
@Data
public class KunDatasource extends DatasourceBase implements Serializable {
    /**
     * 数据源ID
     */
    @TableId(value = "ds_id")
    private String dsId;

    /**
     * 数据源的连接名称
     */
    @TableField(value = "ds_name")
    private String dsName;

    /**
     * 连接描述
     */
    @TableField(value = "ds_describe")
    private String dsDescribe;

    /**
     * 连接类型 0 mysql 1 oracle 2 sqlserver
     */
    @TableField(value = "ds_type")
    private String dsType;

    /**
     * 连接用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 连接密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 连接密码是否加密
     */
    @TableField(value = "has_pwd_enc")
    private Integer hasPwdEnc;

    /**
     * 驱动类名称
     */
    @TableField(value = "driver_class_name")
    private String driverClassName;

    /**
     * 驱动链接
     */
    @TableField(value = "driver_url")
    private String driverUrl;

    /**
     * 驱动jar包路径
     */
    @TableField(value = "driver_jar_path")
    private String driverJarPath;

    /**
     * 驱动链接的扩展属性
     */
    @TableField(value = "driver_url_extend_properties")
    private String driverUrlExtendProperties;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 所属租户
     */
    @TableField(value = "tenant_id")
    private String tenantId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}